import { createApp } from 'vue'
import App from './App.vue'

import store from './store' //vuex需要在main.js里面引入
import router from './router' //和vuex一样 引入

// 导入 Ant Design Vue
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './css/element-variables.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' // Element Plus 中文语言包
// dayjs 本地化为中文（Element Plus 的日期相关组件依赖 dayjs）
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')

import './css/flex.css' // 全局引入flex.css

// 配置 Element Plus 主题色
import { ElConfigProvider } from 'element-plus'

import { appearDirective } from './directives/appear'

import Pagination from '../src/components/currency/pagination.vue'
import Navbar from '../src/components/currency/navbar.vue' //公共头部
import Tabbar from '../src/components/currency/tabbar.vue' //公共底部

const app = createApp(App)

// 使用 Ant Design Vue 与 Element Plus（全局中文）
app.use(Antd)
app.use(ElementPlus, { locale: zhCn })

// 配置 Element Plus 主题色
app.use(ElConfigProvider, {
  size: 'default',
  zIndex: 3000,
  button: {
    autoInsertSpace: true,
  },
})
app.use(store)
app.use(router)
app.directive('appear', appearDirective)

app.component('Pagination', Pagination)
app.component('Navbar', Navbar)
app.component('Tabbar', Tabbar)
app.mount('#app')

//配置公共属性图片域名
const BASEURL = (app.config.globalProperties.$imgUrl = 'https://kjcat.heizixun.com/image')

//配置公共属性域名前缀
const BASEURL1 = (app.config.globalProperties.$apiUrl = 'https://kj.heizixun.com/api/upload/image/')

// app.use(store).use(router).mount("#app");
// vue2的new Vue在v3变成了 createApp
